import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, Matches } from 'class-validator';
import { regMobileCN } from 'src/utils';

export class CreateAuthDto {
  @ApiProperty({
    description: '手机号 唯一',
    example: '15618027935',
  })
  @Matches(regMobileCN, { message: '请输入正确手机号' })
  @IsNotEmpty({ message: '请输入手机号' })
  readonly mobile: string;

  @ApiProperty({
    description: '用户密码',
    example: 'a123123123',
  })
  @IsNotEmpty({ message: '请输入密码' })
  readonly password: string;
}
